

<%@ page import="auctionatr.Auction"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'auction.label', default: 'Auction')}" />
<title><g:message code="auction.anlegen.label" args="[entityName]" /></title>     
<!-- original: code="default.create.label" -->
</head>
<body>

	<div class="body">
		<h1>
			<g:message code="auction.anlegen.label" args="[entityName]" /> <!-- original: code="default.create.label" -->
		</h1>
		<g:if test="${flash.message}">
			<div class="message">
				${flash.message}
			</div>
		</g:if>
		<g:hasErrors bean="${auctionInstance}">
			<div class="errors">
				<g:renderErrors bean="${auctionInstance}" as="list" />
			</div>
		</g:hasErrors>

		<g:form action="save" method="post" enctype="multipart/form-data">

			<div class="dialog">
				<table>
					<tbody>

						<tr class="prop">
							<td valign="top" class="name"><label for="name"><g:message
										code="auction.name.label" default="Name" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: auctionInstance, field: 'name', 'errors')}">
								<g:textField name="name" maxlength="40"
									value="${auctionInstance?.name}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="description"><g:message
										code="auction.description.label" default="Description" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: auctionInstance, field: 'description', 'errors')}">
								<g:textField name="description"
									value="${auctionInstance?.description}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="finishDate"><g:message
										code="auction.finishDate.label" default="Finish Date" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: auctionInstance, field: 'finishDate', 'errors')}">
								<g:datePicker name="finishDate" precision="day"
									value="${auctionInstance?.finishDate}" />
							</td>
						</tr>

				

						<tr class="prop">
							<td valign="top" class="name"><label for="startPrice"><g:message
										code="auction.startPrice.label" default="Start Price" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: auctionInstance, field: 'startPrice', 'errors')}">
								<g:textField name="startPrice"
									value="${fieldValue(bean: auctionInstance, field: 'startPrice')}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="state"><g:message
										code="auction.state.label" default="State" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: auctionInstance, field: 'state', 'errors')}">
								<g:select name="state"
									from="${auctionInstance.constraints.state.inList}"
									value="${auctionInstance?.state}"
									valueMessagePrefix="auction.state" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="shipment"><g:message
										code="auction.shipment.label" default="Shipment" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: auctionInstance, field: 'shipment', 'errors')}">
								<g:select name="shipment"
									from="${auctionInstance.constraints.shipment.inList}"
									value="${auctionInstance?.shipment}"
									valueMessagePrefix="auction.shipment" />
							</td>
						</tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="categories"><g:message code="auction.categories.label" default="Categories" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: auctionInstance, field: 'categories', 'errors')}">
                                    <g:select name="categories.id" from="${auctionatr.Category.list()}" optionKey="id" value="${auctionInstance?.categories?.id}"  />
                                </td>
                            </tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="deliveryCosts"><g:message
										code="auction.deliveryCosts.label" default="Delivery Costs" />
							</label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: auctionInstance, field: 'deliveryCosts', 'errors')}">
								<g:textField name="deliveryCosts"
									value="${fieldValue(bean: auctionInstance, field: 'deliveryCosts')}" />
							</td>
						</tr>


						<tr class="prop">
							<td valign="top" class="name"><label for="picture"><g:message
										code="user.picture.label" default="Picture" /> (500 kB)</label></td>
							<td valign="top" class="value"><input type="file"
								name="picture" id="picture" /></td>
						</tr>

					</tbody>
				</table>
			</div>
			<div class="buttons">
				<span class="button"><g:submitButton name="create"
						class="save"
						value="${message(code: 'default.button.create.label', default: 'Create')}" />
				</span>
			</div>
		</g:form>
	</div>
</body>
</html>
